<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>{:lang('ADMIN_CENTER')}</title>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <link href="__TMPL__/public/assets/css/bootstrap.min.css?v=3.3.7" rel="stylesheet">
    <link href="__STATIC__/font-awesome/css/font-awesome.min.css?page=index" rel="stylesheet" type="text/css">
    <link href="__TMPL__/public/assets/css/animate.css?v=1.0" rel="stylesheet">
    <link href="__TMPL__/public/assets/css/style.css?v=4.1.1" rel="stylesheet">
    <script>
        //全局变量
        var GV = {
            HOST: "{$_SERVER['HTTP_HOST']}",
            ROOT: "__ROOT__/",
            WEB_ROOT: "__WEB_ROOT__/",
            JS_ROOT: "static/js/"
        };
    </script>

    <php>$submenus=$menus;</php>
    <php>function getsubmenu($submenus){</php>
    <notempty name="submenus">
        <php>foreach($submenus as $menu){</php>
        <li>
            <php>
                $menu_name=lang($menu['lang']);
                $menu_name=$menu['lang']==$menu_name?$menu['name']:$menu_name;
            </php>
            <php>if(empty($menu['items'])){</php>
            <a class="J_menuItem" href="{$menu.url}"><i class="fa fa-{$menu.icon|default='desktop'}"></i> <span class="nav-label">{$menu_name}</span></a>
            <php>}else{</php>
                <a href="#">
                    <i class="fa fa fa-{$menu.icon|default='desktop'}"></i>
                    <span class="nav-label">{$menu_name}</span>
                    <span class="fa arrow"></span>
                </a>
                <ul class="nav nav-second-level submenu">
                    <php>getsubmenu1($menu['items'])</php>
                </ul>
                <php>}</php>
            </li>
        <php>}</php>
        </notempty>
    <php>}</php>

    <php>function getsubmenu1($submenus){</php>
    <php>foreach($submenus as $menu){</php>

    <li>
        <php>
            $menu_name=lang($menu['lang']);
            $menu_name=$menu['lang']==$menu_name?$menu['name']:$menu_name;
        </php>
        <php>if(empty($menu['items'])){</php>
         <a class="J_menuItem" href="{$menu.url}"><i class="fa fa-{$menu.icon|default='circle-o'}"></i>{$menu_name}</a>
         <php>}else{</php>
         <a href="#"><i class="fa fa-{$menu.icon|default='circle-o'}"></i>{$menu_name}<span class="fa arrow"></span></a>
          <ul class="nav nav-third-level submenu">
            <php>getsubmenu2($menu['items'])</php>
         </ul>
         <php>}</php>
    </li>

    <php>}</php>
    <php>}</php>

    <php>function getsubmenu2($submenus){</php>
    <php>foreach($submenus as $menu){</php>

    <li>
        <php>
            $menu_name=lang($menu['lang']);
            $menu_name=$menu['lang']==$menu_name?$menu['name']:$menu_name;
        </php>

        <a class="J_menuItem" href="{$menu.url}"><i class="fa fa-{$menu.icon|default='circle-o'}"></i>{$menu_name}</a>

    </li>

    <php>}</php>
    <php>}</php>

</head>

<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
    <div id="wrapper">
        <!--左侧导航开始-->
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="nav-close"><i class="fa fa-times-circle"></i>
            </div>
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element">
                            <span>
                                <if condition="isset($admin['avatar']) && $admin['avatar']">
                                    <img alt="image" class="img-circle" src="{:cmf_get_image_url($admin['avatar'])}" width="64" />
                                <else/>
                                    <img alt="image" class="img-circle" src="__TMPL__/public/assets/images/profile_small.jpg" />
                                </if>
                            </span>
                            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <span class="clear">
                               <span class="block m-t-xs">
                                    <strong class="font-bold">
                                        {:lang('WELCOME_USER',array('user_nickname' => empty($admin['user_nickname'] )? $admin['user_login'] : $admin['user_nickname']))}
                                    </strong>
                                </span>
                                <span class="text-muted text-xs block">操作<b class="caret"></b></span>
                                </span>
                            </a>
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                <if condition="cmf_auth_check(cmf_get_current_admin_id(),'admin/Setting/site')">
                                    <li>
                                        <a class="J_menuItem" href="{:url('setting/site')}">{:lang('ADMIN_SETTING_SITE')}</a>
                                    </li>
                                </if>
                                <if condition="cmf_auth_check(cmf_get_current_admin_id(),'admin/user/userinfo')">
                                    <li>
                                        <a class="J_menuItem" href="{:url('user/userinfo')}">{:lang('ADMIN_USER_USERINFO')}</a>
                                    </li>
                                </if>
                                <if condition="cmf_auth_check(cmf_get_current_admin_id(),'admin/Setting/password')">
                                    <li>
                                        <a class="J_menuItem" href="{:url('setting/password')}">{:lang('ADMIN_SETTING_PASSWORD')}</a>
                                    </li>
                                </if>
                                <li class="divider"></li>
                                <li>
                                    <a href="{:url('Public/logout')}">安全退出</a>
                                </li>
                            </ul>
                        </div>
                        <div class="logo-element">
                          <if condition="isset($admin['avatar']) && $admin['avatar']">
                                    <img alt="image" class="img-circle" src="{:cmf_get_image_url($admin['avatar'])}" width="64" />
                                <else/>
                                    <img alt="image" class="img-circle" src="__TMPL__/public/assets/images/profile_small.jpg" />
                                </if>
                        </div>
                    </li>
                    <!-- nav开始-->
                    {:getsubmenu($submenus)}
                </ul>
            </div>
        </nav>
        <!--左侧导航结束-->
        <!--右侧部分开始-->
        <div id="page-wrapper" class="gray-bg dashbard-1">
            <div class="row border-bottom">
                <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                    <div class="navbar-header"><a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>

                    </div>
                    <ul class="nav navbar-top-links navbar-right">
                        <li>
                            <a href="__ROOT__/" target="_blank">
                                <i class="fa fa-home"></i>主页
                            </a>
                        </li>
                        <if condition="cmf_auth_check(cmf_get_current_admin_id(),'user/AdminAsset/index')">
                            <li>
                                <a class="J_menuItem" href="{:url('user/AdminAsset/index')}">
                                    <i class="fa fa-file"></i>资源管理
                                </a>
                            </li>
                        </if>
                        <if condition="cmf_auth_check(cmf_get_current_admin_id(),'admin/RecycleBin/index')">
                            <li>
                                <a class="J_menuItem" href="{:url('admin/RecycleBin/index')}">
                                    <i class="fa fa-recycle"></i>回收站
                                </a>
                            </li>
                        </if>
                        <if condition="APP_DEBUG">
                            <li>
                                <a class="J_menuItem" href="{:url('admin/Menu/index')}">
                                    <i class="fa fa-list"></i>{:lang('ADMIN_MENU_INDEX')}
                                </a>
                            </li>
                        </if>
                        <if condition="cmf_auth_check(cmf_get_current_admin_id(),'admin/Setting/clearcache')">
                            <li>
                                <a class="clearCache">
                                    <i class="fa fa-trash-o"></i>{:lang('ADMIN_SETTING_CLEARCACHE')}
                                </a>
                            </li>
                        </if>
                        <li>
                            <a id="refresh-wrapper" href="javacript:void(0);" title="{:lang('REFRESH_CURRENT_PAGE')}">
                                     <i class="fa fa-refresh right_tool_icon"></i>{:lang('REFRESH_CURRENT_PAGE')}
                                </a>
                        </li>
                        <li class="dropdown hidden-xs">
                            <a class="right-sidebar-toggle" aria-expanded="false">
                                <i class="fa fa-tasks"></i>主题
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
            <div class="row content-tabs">
                <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
                </button>
                <nav class="page-tabs J_menuTabs">
                    <div class="page-tabs-content">
                        <a href="javascript:;" class="active J_menuTab" data-id="{:url('Main/index')}">{:lang('HOME')}</a>
                    </div>
                </nav>
                <button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i>
                </button>
                <div class="btn-group roll-nav roll-right">
                    <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>

                    </button>
                    <ul role="menu" class="dropdown-menu dropdown-menu-right">
                        <li class="J_tabShowActive"><a>定位当前选项卡</a>
                        </li>
                        <li class="divider"></li>
                        <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
                        </li>
                        <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
                        </li>
                    </ul>
                </div>
                <a href="{:url('Public/logout')}" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
            </div>
            <div class="row J_mainContent" id="content-main">
                <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="{:url('Main/index')}" frameborder="0" data-id="{:url('Main/index')}" seamless></iframe>
            </div>
            <div class="footer">
                <div class="pull-left">Admin Panel
                </div>
            </div>
        </div>
        <!--右侧部分结束-->
        <!--右侧边栏开始-->
        <div id="right-sidebar">
            <div class="sidebar-container">
                <ul class="nav nav-tabs navs-3">
                    <li class="active">
                        <a data-toggle="tab" href="#tab-1">
                            <i class="fa fa-gear"></i> 主题
                        </a>
                    </li>
                </ul>

                <div class="tab-content">
                    <div id="tab-1" class="tab-pane active">
                        <div class="sidebar-title">
                            <h3> <i class="fa fa-comments-o"></i>主题设置</h3>
                            <small><i class="fa fa-tim"></i> 你可以从这里选择和预览主题的布局和样式，这些设置会被保存在本地，下次打开的时候会直接应用这些设置。</small>
                        </div>
                        <div class="skin-setttings">
                            <div class="title">主题设置</div>
                            <div class="setings-item">
                                <span>收起左侧菜单</span>
                                <div class="switch">
                                    <div class="onoffswitch">
                                        <input type="checkbox" name="collapsemenu" class="onoffswitch-checkbox" id="collapsemenu">
                                        <label class="onoffswitch-label" for="collapsemenu">
                                            <span class="onoffswitch-inner"></span>
                                            <span class="onoffswitch-switch"></span>
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="setings-item">
                                <span>固定顶部</span>

                                <div class="switch">
                                    <div class="onoffswitch">
                                        <input type="checkbox" name="fixednavbar" class="onoffswitch-checkbox" id="fixednavbar">
                                        <label class="onoffswitch-label" for="fixednavbar">
                                            <span class="onoffswitch-inner"></span>
                                            <span class="onoffswitch-switch"></span>
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="setings-item">
                                <span>
                        固定宽度
                    </span>

                                <div class="switch">
                                    <div class="onoffswitch">
                                        <input type="checkbox" name="boxedlayout" class="onoffswitch-checkbox" id="boxedlayout">
                                        <label class="onoffswitch-label" for="boxedlayout">
                                            <span class="onoffswitch-inner"></span>
                                            <span class="onoffswitch-switch"></span>
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="title">皮肤选择</div>
                            <div class="setings-item default-skin nb">
                                <span class="skin-name ">
                         <a href="#" class="s-skin-0">
                             默认皮肤
                         </a>
                    </span>
                            </div>
                            <div class="setings-item blue-skin nb">
                                <span class="skin-name ">
                        <a href="#" class="s-skin-1">
                            蓝色主题
                        </a>
                    </span>
                            </div>
                            <div class="setings-item yellow-skin nb">
                                <span class="skin-name ">
                        <a href="#" class="s-skin-3">
                            黄色/紫色主题
                        </a>
                    </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--右侧边栏结束-->
    </div>

    <!-- 全局js -->
    <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/wind.js"></script>
    <script src="__TMPL__/public/assets/js/bootstrap.min.js?v=3.3.7"></script>
    <script src="__STATIC__/js/admin.js?v=1.1"></script>
    <script src="__TMPL__/public/assets/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="__TMPL__/public/assets/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <script src="__TMPL__/public/assets/js/plugins/layer/layer.min.js"></script>
    <!-- 自定义js -->
    <script src="__TMPL__/public/assets/js/hplus.js?v=4.1.0"></script>
    <script type="text/javascript" src="__TMPL__/public/assets/js/contabs.js"></script>
    <script src="__TMPL__/public/assets/js/plugins/pace/pace.min.js"></script>
    <!-- 清理缓存 -->
    <script type="text/javascript">
        //清除缓存
    $(".clearCache").click(function(){
        $.ajax({
            url: '{:url('admin/Setting/clearCache')}',
            success:function(res){
                var index = layer.msg('清除缓存中，请稍候',{icon: 16,time:false,shade:0.8});
                setTimeout(function(){
                    layer.close(index);
                    layer.msg("缓存清除成功！",{icon: 1});
                },1000);
            }
        })
    })

    $("#refresh-wrapper").click(function () {
        var $currentIframe = $("#content-main iframe:visible");
        layer.load(2);
        setTimeout(function(){
        $currentIframe[0].contentWindow.location.reload();
          layer.closeAll('loading');
          return false;
        }, 500);
    });


    </script>
</body>

</html>
